<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>

assert_true(document.prerendering);

async function invokeWebShareAPI(){
  const bc = new BroadcastChannel('prerender-channel');

  try {
    const _ = await navigator.share({url: 'https://a.test'});
    bc.postMessage('unexpected success');
  } catch (err){
    bc.postMessage(err.name);
  } finally {
    bc.close();
  }
}

invokeWebShareAPI();

</script>
